package com.gsafety.libraryktx.widget

import android.content.Context
import android.graphics.Typeface
import android.view.LayoutInflater
import android.widget.LinearLayout
import android.widget.TextView
import com.gsafety.libraryktx.R

class SelectedTitleView(context: Context?, text: String) : LinearLayout(context){
    var title:TextView?=null
    init {
        LayoutInflater.from(context).inflate(R.layout.common_selected_title,this)
        title = findViewById<TextView>(R.id.tv_title)
        title!!.text = text
    }

    override fun setSelected(selected:Boolean) {
        super.setSelected(selected)
        if(selected) {
            title?.typeface = Typeface.DEFAULT_BOLD
        }else{
            title?.typeface = Typeface.DEFAULT
        }
    }
}